package com.kanshu.basictest.ui.activity.basic;

import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;

import com.kanshu.basictest.R;
import com.kanshu.basictest.model.menu.MenuItem;
import com.kanshu.basictest.ui.base.BaseListMenuActivity;

import java.util.ArrayList;
import java.util.List;

public class BasicIndexActivity extends BaseListMenuActivity {


    @Override
    protected String provideBarTitle() {
        return "AndroidBasicTest";
    }

    public static final String TAG = "MainActivity";


    @Override
    protected List<? extends MenuItem> provideMenuData() {
        List<MenuItem> menuItems = new ArrayList<>();
        menuItems.add(0, new MenuItem("Application", R.color.brown_300));
        menuItems.add(1, new MenuItem("JSON", R.color.brown_300));
        menuItems.add(2, new MenuItem("XML", R.color.brown_300));
        menuItems.add(3, new MenuItem("Annotation", R.color.brown_300));

        return menuItems;
    }

    @Override
    protected void init() {
        super.init();
    }

    @Override
    public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
        Intent intent = new Intent();
        switch (position) {
            case 0://Application
                break;
            case 1://JSON
                intent.setClass(this, JsonActivity.class);
                break;
            case 2://XML
                break;
            case 3://Annotation
                intent.setClass(this, AnnotationActivity.class);
                break;
            default:
                break;

        }

        startActivity(intent);
    }


}
